﻿using JJMent.Core.Models;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Text;

namespace JJMent.EFCore
{
    public static class ModeBuilderExtensions
    {
        public static void Seed(this ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<ProductType>().HasData(
               new ProductType
               {

                   Id = 1,
                   ProductTypeName = "椅子"
               },
               new ProductType
               {
                   Id = 2,
                   ProductTypeName = "餐桌"
               },
               new ProductType
               {
                   Id = 3,
                   ProductTypeName = "沙发"
               },
                new ProductType
                {
                    Id = 4,
                    ProductTypeName = "创意"
                }
               );
            modelBuilder.Entity<Product>().HasData(
                new Product
                {
                    Id = 1,
                    ProductName = "牛皮单人软椅",
                    ProductmMterial = "牛皮,桐木",
                    Price = "230",
                    MarketValue = "250",
                    Brand = "自制",
                    Colour = "红",
                    ProductTypeId = 1
                },
                 new Product
                 {
                     Id = 2,
                     ProductName = "貂皮单人软椅",
                     ProductmMterial = "貂皮,桐木",
                     Price = "430",
                     MarketValue = "450",
                     Brand = "自制",
                     Colour = "红",
                     ProductTypeId = 1
                 },
                 new Product
                 {
                     Id = 3,
                     ProductName = "牛皮三人软椅",
                     ProductmMterial = "牛皮,桐木",
                     Price = "400",
                     MarketValue = "450",
                     Brand = "自制",
                     Colour = "红",
                     ProductTypeId = 1
                 },
                 new Product
                 {
                     Id = 4,
                     ProductName = "三人不锈钢餐桌",
                     ProductmMterial = "不锈钢",
                     Price = "400",
                     MarketValue = "450",
                     Brand = "自制",
                     Colour = "银",
                     ProductTypeId = 2
                 },
                  new Product
                  {
                      Id = 5,
                      ProductName = "三人桐木餐桌",
                      ProductmMterial = "桐木",
                      Price = "500",
                      MarketValue = "550",
                      Brand = "自制",
                      Colour = "红",
                      ProductTypeId = 2
                  },
                  new Product
                  {
                      Id = 6,
                      ProductName = "八人桐木餐桌",
                      ProductmMterial = "桐木",
                      Price = "600",
                      MarketValue = "650",
                      Brand = "自制",
                      Colour = "红",
                      ProductTypeId = 2
                  },
                  new Product
                  {
                      Id = 7,
                      ProductName = "八人不锈钢餐桌",
                      ProductmMterial = "不锈钢",
                      Price = "700",
                      MarketValue = "750",
                      Brand = "自制",
                      Colour = "红",
                      ProductTypeId = 2
                  }
                );
        }
    }
}
